package com.gitee.linzl.domain;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;

import org.hibernate.annotations.BatchSize;

import com.fasterxml.jackson.annotation.JsonIgnore;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Entity
@Data
@EqualsAndHashCode(callSuper = false)
public class Role implements Serializable {
	@Id
	private Long id;
	private String name;
	private String value;

	@JsonIgnore
	@ManyToMany(targetEntity = Authority.class, fetch = FetchType.EAGER)
	@BatchSize(size = 20)
	private Set<Authority> authorities = new HashSet<>();

}
